package com.lhc;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@SpringBootTest(classes = RaabbitMQApp.class)
@RunWith(SpringRunner.class)
public class App {
    @Autowired
    AmqpTemplate amqpTemplate;
    @Test
    public void test01(){
        amqpTemplate.convertAndSend("hello","hello.world...");
    }

    @Test
    public void test02(){
        for (int i = 0; i < 10; i++) {
            amqpTemplate.convertAndSend("queen_work02","这是work模式");
        }
    }

    @Test
    public void test03(){
        amqpTemplate.convertAndSend("exchange-fanout","","这是fanout模式");
    }

    @Test
    public void test04(){
        amqpTemplate.convertAndSend("exchange-fanout","“”","这是fanout模式");
    }

    @Test
    public void test05(){
        amqpTemplate.convertAndSend("routing-topic","user","这是路由-订阅模型");
    }
}
